#include "Comm.hpp"
using namespace std;
int main()
{
    //write
    int fd = open(NAME_PIPE,O_WRONLY | O_CREAT);
    if(fd<0)
    cout<<"打开文件失败，write"<<endl;
    char buffer[1024];
    while(1)
    {
        cout<<"please Say :";
        fgets(buffer,sizeof(buffer),stdin);
        buffer[strlen(buffer)-1] = 0;
        int n = write(fd,buffer,strlen(buffer));
        assert(n != -1);
    }
    close(fd);
}